const download = {};

download.byBlob=(blob,filename)=>{
  let a = document.createElement('a');
  let url = window.URL.createObjectURL(blob);
  if(filename){
    a.href = url;
    a.download = filename; // 给下载下来的文件起个名字
    a.click();
    window.URL.revokeObjectURL(url);
    a = null;
  }
};

export default download;
